Speed up code for arm architecture when creating new rules#341
Speed up code for arm architecture when creating new rules#341ldx merged 2 commits intoldx:masterfrom
Conversation
Sorry, this escaped my attention. If you still would like to merge it, please rebase it on current master and I'm happy to take a look. |
5cbda3a to
b7c071a
Compare
|
I updated the branch with a rebase. Can you have a look at it? |
I think this is a great idea if this gives a speed bump. That being said, I'd much rather implement this caching via something like a static class field instead of a global variable. Any chance you can refactor this? |
75a5d1e to
7bdd451
Compare
7bdd451 to
f631fe0
Compare
|
Thanks for your hint. In my new commit, I moved the variable to a static class variable. |
|
@ldx What has to be changed to merge this improvement? |
|
@jkklemm merged, thank you for your patience! |
Since the arm architecture is slow to always lookup the tables, the creation of many rules with standard targets like Accept or Reject can slow down the creation of firewall rules. For this reason, a dictionary is used to check available tables and standard targets are not check if they are a chain.
This code can halve the execution time on an Arm architectures if many firewall rules are created.